<?php
// +----------------------------------------------------------------------
// | 麦沃德科技赋能开发者，助力中小企业发展
// +----------------------------------------------------------------------
// | Copyright (c) 2017～2024  www.wdadmin.cn    All rights reserved.
// +----------------------------------------------------------------------
// | Wdadmin系统产品软件并不是自由软件，不加密，并不代表开源，未经许可不可自由转售和商用
// +----------------------------------------------------------------------
// | Author: MY WORLD Team <bd@maiwd.cn>   www.wdadmin.cn
// +----------------------------------------------------------------------
/**
 * Class SecurityCenter
 * Desc  安全中心控制器
 * Create on 2024/10/22 16:08
 * Create by wangyafang
 */

namespace app\api\controller\wddj\driver;


use app\api\model\wddj\User;
use app\common\controller\Api;

class SecurityCenter extends Api
{
    protected $noNeedLogin = [''];
    protected $noNeedRight = ['center'];

    public function _initialize()
    {
        parent::_initialize();
    }

    /**
     * Desc 安全中心
     * Create on 2024/10/22 15:27
     * Create by wangyafang
     */
    public function center()
    {
        if(!$this->request->isGet()) {
            $this->error('请求类型错误');
        }

        $driverModel = new \app\api\model\wddj\driver\Driver();
        $driverObj = $driverModel->where('wechat_id',User::getWechatId($this->auth->id))->find();

        $data = array(
            'certification_status'=>$driverObj ? 1 : 2,
        );
        $this->success('请求成功',$data);
    }
}



 